package com.cap.bts.crmdp.dealer.mars.domain;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;

import com.cap.bts.framework.common.domain.BaseDomain;

@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "tl_data_conversion_log")
public class DataConversionLog extends BaseDomain implements Serializable {

    private static final long serialVersionUID = 3292243745940975457L;
    
    private static final  String FORMAT = "yyyy-MM-dd HH:mm:ss";

    private Long id;

    private String batchId;
    private String paramText;

    private String sendText;
    private String returnText;

    private String status;

    private String descp;

    public DataConversionLog() {

    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    
    @Column(name = "BATCH_ID")
    public String getBatchId() {
		return batchId;
	}

	public void setBatchId(String batchId) {
		this.batchId = batchId;
	}

	@Column(name = "PARAM_TEXT")
    public String getParamText() {
        return paramText;
    }

    public void setParamText(String paramText) {
        this.paramText = paramText;
    }

    @Column(name = "RETURN_TEXT")
    public String getReturnText() {
        return returnText;
    }

    public void setReturnText(String returnText) {
        this.returnText = returnText;
    }


    @Column(name = "DESCP")
    public String getDescp() {
        return descp;
    }

    public void setDescp(String descp) {
        this.descp = descp;
    }

    @Column(name = "SEND_TEXT")
	public String getSendText() {
		return sendText;
	}

	public void setSendText(String sendText) {
		this.sendText = sendText;
	}

	@Column(name = "STATUS")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	
	private String callTime;
	private String sendTime;
	
	
	@Transient
    public String getCallTime() {
        Date createTime = getCreateDate();
        if (createTime != null) {
            callTime = new SimpleDateFormat(FORMAT).format(createTime);
        }
        return callTime;
    }

    public void setCallTime(String callTime) {
        this.callTime = callTime;
    }

    @Transient
	public String getSendTime() {
		Date sendDate = getLastUpdateDate();
        if (sendDate != null) {
        	sendTime = new SimpleDateFormat(FORMAT).format(sendDate);
        }
		return sendTime;
	}

	public void setSendTime(String sendTime) {
		this.sendTime = sendTime;
	}


    
    
    

}
